package com.ruoyi.experiment.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.experiment.mapper.FirewallRuleMapper;
import com.ruoyi.experiment.domain.FirewallRule;
import com.ruoyi.experiment.service.IFirewallRuleService;

import javax.annotation.Resource;

/**
 * 防火墙规则Service业务层处理
 * 
 * @author 邓鑫
 * @date 2023-07-28
 */
@Service
public class FirewallRuleServiceImpl implements IFirewallRuleService 
{
    @Resource
    private FirewallRuleMapper firewallRuleMapper;

    /**
     * 查询防火墙规则
     * 
     * @param firewallRuleId 防火墙规则主键
     * @return 防火墙规则
     */
    @Override
    public FirewallRule selectFirewallRuleByFirewallRuleId(Long firewallRuleId)
    {
        return firewallRuleMapper.selectFirewallRuleByFirewallRuleId(firewallRuleId);
    }

    /**
     * 查询防火墙规则列表
     * 
     * @param firewallRule 防火墙规则
     * @return 防火墙规则
     */
    @Override
    public List<FirewallRule> selectFirewallRuleList(FirewallRule firewallRule)
    {
        return firewallRuleMapper.selectFirewallRuleList(firewallRule);
    }

    /**
     * 新增防火墙规则
     * 
     * @param firewallRule 防火墙规则
     * @return 结果
     */
    @Override
    public int insertFirewallRule(FirewallRule firewallRule)
    {
        return firewallRuleMapper.insertFirewallRule(firewallRule);
    }

    /**
     * 修改防火墙规则
     * 
     * @param firewallRule 防火墙规则
     * @return 结果
     */
    @Override
    public int updateFirewallRule(FirewallRule firewallRule)
    {
        return firewallRuleMapper.updateFirewallRule(firewallRule);
    }

    /**
     * 批量删除防火墙规则
     * 
     * @param firewallRuleIds 需要删除的防火墙规则主键
     * @return 结果
     */
    @Override
    public int deleteFirewallRuleByFirewallRuleIds(Long[] firewallRuleIds)
    {
        return firewallRuleMapper.deleteFirewallRuleByFirewallRuleIds(firewallRuleIds);
    }

    /**
     * 删除防火墙规则信息
     * 
     * @param firewallRuleId 防火墙规则主键
     * @return 结果
     */
    @Override
    public int deleteFirewallRuleByFirewallRuleId(Long firewallRuleId)
    {
        return firewallRuleMapper.deleteFirewallRuleByFirewallRuleId(firewallRuleId);
    }

    /**
     * 策略查询防火墙规则列表 不带参数
     */
    @Override
    public List<FirewallRule> getList() {
        return firewallRuleMapper.getList();
    }
}
